#ifndef __TEXTURECLASSIFICATION_H__
#define __TEXTURECLASSIFICATION_H__

#include <string>
#include <vector>

#include "Image.H"

template <class T>
void getMinMaxImage(const pip::Image<T>& in, T& min, T& max)
{
  min = std::numeric_limits<T>::max();
  max = std::numeric_limits<T>::min();

  const int xDim(in.dim(0)), yDim(in.dim(1));
  for (int y = 0; y < yDim; ++y) {
    for (int x = 0; x < xDim; ++x) {
      const T value(in(x, y));

      if (value > max) {
        max = value;
      }

      if (value < min) {
        min = value;
      }
    }
  }
}

void filterSeparable(const pip::Image<float>& in, pip::Image<float>& out, const std::vector<std::vector<float> >& kernels, const pip::BorderInfo& bi = pip::border_mirror);
void histogram(const pip::Image<float>& in, std::vector<float>& h, const int& nrBins = 5);
void Law3(const pip::Image<float>& in, pip::Image<float>& out, const std::string& filter = "LL");
void preprocess(const pip::Image<float>& in, pip::Image<float>& out);

#endif